<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<!-- 
		Replace path to template, title, header and body
		with actual data.
	 -->
	<ui:composition template="/templates/template.xhtml">
			<ui:define name="pageTitle">Membro</ui:define>
			<ui:define name="pageHeader">Cadastro de Membros</ui:define>
			<ui:define name="body">
				<h:form id ="formCadMembro">
				<h:messages />
					<h:panelGrid columns="2">
						<h:outputLabel value="Nome:" />
						<h:inputText value="#{membroBean.membroSelecionado.nome}" />
						
						<h:outputLabel value="Login:" />
						<h:inputText value="#{membroBean.membroSelecionado.login}" />
						
						<h:outputLabel value="Senha:" />
						<h:inputText value="#{membroBean.membroSelecionado.senha}" />
						
					</h:panelGrid>
					
					<h:commandButton value="Salvar" action="#{membroBean.salvar}" />
								
				</h:form>
			
			<h:form id="lista">
				 <h:dataTable value="#{membroBean.lista}" var="membro" border="1">
				 <f:facet name="header">Listagem de membros</f:facet>
				 	
				 	<h:column>
				 	<f:facet name="header">Nome</f:facet>	
				 	#{membro.nome}
				 	</h:column>
				 	
				 	<h:column>
				 	<f:facet name="header">Login</f:facet>	
				 	#{membro.login}
				 	</h:column>
				 	
				 	<h:column>
				 	<f:facet name="header">Email</f:facet>	
				 	#{membro.email}
				 	</h:column>
				 	
				 	<h:column>
				 	<f:facet name="header">Senha</f:facet>	
				 	#{membro.senha}
				 	</h:column>
				 	
				 	<h:column>
				 	<f:facet name="header">Data de Cadastro</f:facet>	
				 	<h:outputText value="#{membro.dataCadastro}" >
				 		<f:convertDateTime dateStyle="medium"/>
				 	</h:outputText>
				 	</h:column>
				 	
				 	<h:column>
				 	<f:facet name="header">Status</f:facet>	
				 	#{membro.status}
				 	</h:column>
				 </h:dataTable>
			</h:form>
			
			</ui:define>
	</ui:composition>

</html>